package com.ruoyi.yljf.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.yljf.mapper.UserVipMapper;
import com.ruoyi.yljf.domain.UserVip;
import com.ruoyi.yljf.service.IUserVipService;

/**
 * 用户会员记录Service业务层处理
 * 
 * @author TAT
 * @date 2025-04-11
 */
@Service
public class UserVipServiceImpl extends ServiceImpl<UserVipMapper, UserVip> implements IUserVipService {
    @Autowired
    private UserVipMapper userVipMapper;
    
    /**
     * 查询用户会员记录列表
     * 
     * @param userVip 用户会员记录
     * @return 用户会员记录
     */
    @Override
    public List<UserVip> selectUserVipList(UserVip userVip) {
    	LambdaQueryWrapper<UserVip> queryWrapper = Wrappers.lambdaQuery();
        if (StringUtils.isNotEmpty(userVip.getUserId())) {
			queryWrapper.eq(UserVip::getUserId, userVip.getUserId());
		}
        if (StringUtils.isNotNull(userVip.getStartTime())) {
			queryWrapper.eq(UserVip::getStartTime, userVip.getStartTime());
		}
        if (StringUtils.isNotNull(userVip.getExpirationTime())) {
			queryWrapper.eq(UserVip::getExpirationTime, userVip.getExpirationTime());
		}
        if (StringUtils.isNotNull(userVip.getPrice())) {
			queryWrapper.eq(UserVip::getPrice, userVip.getPrice());
		}
        if (StringUtils.isNotEmpty(userVip.getStatu())) {
			queryWrapper.eq(UserVip::getStatu, userVip.getStatu());
		}
        if (StringUtils.isNotEmpty(userVip.getPayMethod())) {
			queryWrapper.eq(UserVip::getPayMethod, userVip.getPayMethod());
		}
        return userVipMapper.selectList(queryWrapper);
    }
}
